<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <table border="1" cellspacing="1" cellpadding="10" style="margin-top: 10px;">
        <tbody>
            <tr>
                <th>userId</th>
                <th>id</th>
                <th>title</th>
                <th>body</th>
            </tr>
        </tbody>
        <script>
            function _get(limit, page, cd) {
                let xhr = new XMLHttpRequest();
                let url = `http://jsonplaceholder.typicode.com/posts?_limit=${limit}&_page=${page}`;
                xhr.open("GET", url);
                xhr.send();
                xhr.addEventListener('readystatechange', function() {
                    if (xhr.readyState == 4) {
                        if (xhr.status == 200) {
                            let data = JSON.parse(xhr.responseText);
                            cd(data);
                        }
                    }
                })
            }

            function show(data) {
                let tbody = document.querySelector('tbody')
                data.forEach(function(ele) {
                    tbody.innerHTML += `
                <tr>
                <td>${ele.userId}</td>   
                 <td>${ele.id}</td>   
                 <td>${ele.title}</td>   
                 <td>${ele.body}</td>    
                </tr>
                `
                });
            };
            _get(10, 1, show);
        </script>
</body>

</html>